/*
 * Copyright (c) OpenKoala 2011 All Rights Reserved
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.openkoala.koala.dd.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.openkoala.koala.dd.event.SerializableUtil;
import org.openkoala.koala.dd.pojo.DDTree;
import org.openkoala.koala.dd.pojo.StaticKeyValue;

/**
 * 类    名：StaticDropUtil.java
 *   
 * 功能描述：获取字典的帮助类	
 *  
 * 创建日期：2013-2-1下午3:09:55     
 * 
 * 版本信息：
 * 
 * 版权信息：Copyright (c) 2013 Koala All Rights Reserved
 * 
 * 作    者：lingen(lingen.liu@gmail.com)
 * 
 * 修改记录： 
 * 修 改 者    修改日期     文件版本   修改说明	
 */
public class StaticDropUtil {
    
    public Map<String,Map<String,String>> getStaticDatas(){
        Map<String,Map<String,String>> keyMaps = new HashMap<String,Map<String,String>>();
        List<DDTree> trees =  SerializableUtil.getStaticDictFromSerializable();
        for(DDTree tree:trees){
            List<StaticKeyValue> values = tree.getValues();
            Map<String,String> valueMap = new HashMap<String,String>();
            for(StaticKeyValue value:values){
                valueMap.put(value.getKey(), value.getValue());
            }
            keyMaps.put(tree.getName(), valueMap);
        }
        return keyMaps;
    }
    
}
